VERSION 5.00
Begin VB.Form frmPagos 
   Caption         =   "Pagos"
   ClientHeight    =   6000
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   8955
   LinkTopic       =   "Form1"
   ScaleHeight     =   6000
   ScaleWidth      =   8955
   StartUpPosition =   3  'Windows Default
   Begin VB.ListBox List5 
      Height          =   1425
      Left            =   0
      TabIndex        =   17
      Top             =   1920
      Width           =   615
   End
   Begin VB.TextBox Text2 
      Height          =   495
      Left            =   4920
      TabIndex        =   14
      Top             =   3720
      Width           =   1215
   End
   Begin VB.TextBox Text1 
      Height          =   495
      Left            =   1440
      TabIndex        =   13
      Top             =   3720
      Width           =   1215
   End
   Begin VB.CommandButton Command3 
      Caption         =   "&Cancelar"
      BeginProperty Font 
         Name            =   "Eras Bold ITC"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   4440
      TabIndex        =   12
      Top             =   5040
      Width           =   1455
   End
   Begin VB.CommandButton Command2 
      Caption         =   "&Guardar"
      BeginProperty Font 
         Name            =   "Eras Bold ITC"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   2160
      TabIndex        =   11
      Top             =   5040
      Width           =   1455
   End
   Begin VB.ListBox List4 
      Height          =   1425
      Left            =   5640
      TabIndex        =   9
      Top             =   1920
      Width           =   2895
   End
   Begin VB.ListBox List3 
      Height          =   1425
      Left            =   2760
      TabIndex        =   7
      Top             =   1920
      Width           =   2895
   End
   Begin VB.ListBox List2 
      Height          =   1425
      Left            =   2160
      TabIndex        =   5
      Top             =   1920
      Width           =   615
   End
   Begin VB.ListBox List1 
      Height          =   1425
      Left            =   600
      TabIndex        =   4
      Top             =   1920
      Width           =   1575
   End
   Begin VB.CommandButton Command1 
      Caption         =   "Buscar Facturas"
      BeginProperty Font 
         Name            =   "Eras Bold ITC"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   5160
      TabIndex        =   3
      Top             =   600
      Width           =   2415
   End
   Begin VB.ComboBox Combo1 
      Height          =   315
      Left            =   2160
      TabIndex        =   1
      Text            =   "Combo1"
      Top             =   600
      Width           =   2775
   End
   Begin VB.Label SkinLabel1 
      Height          =   255
      Left            =   1080
      TabIndex        =   0
      Top             =   600
      Width           =   1455
   End
   Begin VB.Label SkinLabel2 
      Height          =   255
      Left            =   600
      TabIndex        =   2
      Top             =   1680
      Width           =   1455
   End
   Begin VB.Label SkinLabel3 
      Height          =   255
      Left            =   2160
      TabIndex        =   6
      Top             =   1680
      Width           =   495
   End
   Begin VB.Label SkinLabel4 
      Height          =   255
      Left            =   2760
      TabIndex        =   8
      Top             =   1680
      Width           =   2895
   End
   Begin VB.Label SkinLabel5 
      Height          =   255
      Left            =   5640
      TabIndex        =   10
      Top             =   1680
      Width           =   2895
   End
   Begin VB.Label SkinLabel6 
      Height          =   255
      Left            =   240
      TabIndex        =   15
      Top             =   3720
      Width           =   1455
   End
   Begin VB.Label SkinLabel7 
      Height          =   255
      Left            =   3480
      TabIndex        =   16
      Top             =   3720
      Width           =   1455
   End
End
Attribute VB_Name = "frmPagos"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Sub Seleccionar(i)
On Error Resume Next
    List1.Selected(i) = True
    List2.Selected(i) = True
    List3.Selected(i) = True
    List4.Selected(i) = True
    List5.Selected(i) = True
    Dim t As DAO.Recordset
    n = Val(List5.Text)
    Set t = Base.OpenRecordset("select *from almacen_compra where numero_compra=" & n)
    If Not t.EOF Then
        Text1.Text = t("monto1")
        Text2.Text = t("monto2")
    Else
        Text1.Text = ""
        Text2.Text = ""
    End If

End Sub

Sub mostrar()
    List1.Clear
    List2.Clear
    List3.Clear
    List4.Clear
    List5.Clear
    Dim t As DAO.Recordset
    Set t = Base.OpenRecordset("select *from almacen_compra,Almacen_Proveedor where almacen_compra.codigo_proveedor = Almacen_Proveedor.cod_proveedor and razon_social='" & Combo1.Text & "'")
    While Not t.EOF
        List5.AddItem t(0)
        List1.AddItem t("fecha")
        List2.AddItem t("cantidad")
        On Error Resume Next
        If Not IsNull(t("cod_material")) Then
        List3.AddItem t("cod_material")
        Else
        List3.AddItem 0
        End If
        If Not IsNull(t("montototal")) Then
        List4.AddItem t("montototal")
        Else
        List4.AddItem 0
    
        End If
    
        t.MoveNext
    Wend
        
    
End Sub

Private Sub Command1_Click()
mostrar
End Sub

Private Sub Command2_Click()
Dim t As DAO.Recordset
Base.Execute ("update Almacen_Compra set Monto1=" & Val(Text1.Text) & ", Monto2=" & Val(Text2.Text) & " where numero_compra=" & Val(List5.Text))
Text1.Text = ""
Text2.Text = ""
Combo1.Text = ""
List1.Clear
List2.Clear
List3.Clear
List4.Clear
List5.Clear

End Sub

Private Sub Command3_Click()
    Unload Me
End Sub

Private Sub Form_Load()
    LlenarCombo Combo1, "select razon_social from Almacen_Proveedor"
End Sub

Private Sub Label1_Click()

End Sub

Private Sub List1_Click()
Seleccionar List1.ListIndex
End Sub

Private Sub List2_Click()
Seleccionar List2.ListIndex
End Sub

Private Sub List3_Click()
Seleccionar List3.ListIndex
End Sub

Private Sub List4_Click()
Seleccionar List4.ListIndex
End Sub

Private Sub List5_Click()
Seleccionar List5.ListIndex
End Sub
